I am trying to make my program fully color customizable. Thereīs a "Config Color" window where the user can click to open a ChooseColor common dialog to select TXT and BG color for all the controls. This color config is saved into a ini file.

Until now, i was able to change the color of all the Static Controls, ListBoxes, Edit Controls and CheckBoxes via intercepting WM_CTLCOLORSTATIC, WM_CTLCOLORLISTBOX, WM_CTLCOLOREDIT and WM_CTLCOLORBTN.

Looks good, but I got some problems thou: Thereīs really no point on changing BG and TXT color fo all the controls without changing my MainWindow BG and TABS BG.

Well i have absolutely no idea on how to change the Main Window BG color yet, so any help will be fantastic.

About changing the TABS BG color, someone told me that the only way would be to create an Owner Drawn Tab Control.
I would like to know if thereīs really no other way cause iīve never done it Owner Drawn, it will be a pain in the ass to create it.


If thereīs no other way, does anyone knows where to find a good example of how to implement and use Owner-Drawn Tabs using WinAPI? All I could find on my googling are VB and MFC examples. English is not my native language so maybe I skip something good. MSDN stuff on that was not clear enough for me.

But please, tell me thereīs an easier way

Just to make everything clear I am using my Tab Control like this right now:

Code:
static int tabnumber;
TCITEM tci;
NMHDR *nmptr;

hwndTab = CreateWindowEx(0, WC_TABCONTROL, "", 
      WS_CHILD | TCS_RIGHTJUSTIFY | TCS_MULTILINE | /WS_VISIBLE,
      3, 0, 358, 383, mainWindow, (HMENU) 10, ((LPCREATESTRUCT) lParam)->hInstance,  NULL); 

      tci.mask=TCIF_TEXT; 
      tci.iImage=-1; 
      tci.pszText = "Status:"; 
      TabCtrl_InsertItem(hwndTab,0,&tci); 
      tci.pszText = "Servers/Logging Setup:"; 
      TabCtrl_InsertItem(hwndTab,1,&tci); 
      tci.pszText = "Looks:"; 
      TabCtrl_InsertItem(hwndTab,2,&tci); 
      tci.pszText = "Info:"; 
      TabCtrl_InsertItem(hwndTab,3,&tci);
And I am intercepting TCN_SELCHANGE at WM_NOTIFY to catch the number of the active tab and calling functions at each os this cases to Show/Hide/Enable/Disable controls at each tab change:

Code:
case WM_NOTIFY:      
      nmptr=(LPNMHDR)lParam; 
      switch(nmptr->code) {
        case TCN_SELCHANGE:  
          updatetooltips();
          tabnumber = TabCtrl_GetCurSel((HWND)nmptr->hwndFrom); 
          switch(tabnumber) {
            case 0:
            showStatusTab();
            break;
            
            case 1:
            if (mwsize==0){
              setsize();
            }
            showServersTab();
            break;
            
            case 2:
            if (mwsize==0){
              setsize();
            }
            showLooksTab();
            break;          
          
            case 3:
            if (mwsize==0){
              setsize();
            }
            showInfoTab();
            break;
          }
        default:
        return DefWindowProc (mainWindow, messages, wParam, lParam);
      }
Once i add the 'TCS_OWNERDRAWFIXED' style to the Tab Control, the app compiles normally (with MingW, GCC 3.2) and the program works ok. The Tabs are displayed and work ok (I can change between them, so the TCN_SELCHANGE stuff is working). Only problem is that the Title in each TAB disappear and the TAB has some glitches. I really donīt know how to handle this Owner Drawn Tab...

Thatīs it, hope someone can help me on that
Thanks!